package com.esri.core.runtime;

import com.esri.core.portal.LicenseInfo;
import java.util.Date;

/* loaded from: classes.dex */
public final class LicenseImpl {
    private boolean a = false;

    private native String nativeGenerateLicenseInfo(boolean z, long j);

    private native long nativeGetExpiry();

    private native int nativeGetLicenseLevel();

    private native boolean nativeIsClientIdValid(String str);

    private native int nativeIsExtensionLicenseStringValid(String[] strArr);

    private native int nativeIsLicenseInfoValid(String str);

    private native int nativeIsLicenseStringValid(String str);

    private native void nativeUnlicense();

    public LicenseLevel a() {
        return LicenseLevel.a(nativeGetLicenseLevel());
    }

    public String a(boolean z, long j) {
        return nativeGenerateLicenseInfo(z, j);
    }

    public LicenseResult a(LicenseInfo licenseInfo) {
        return licenseInfo != null ? LicenseResult.a(nativeIsLicenseInfoValid(licenseInfo.toJson())) : LicenseResult.INVALID;
    }

    public LicenseResult a(String str) {
        LicenseResult licenseResult = LicenseResult.INVALID;
        return LicenseResult.a(nativeIsLicenseStringValid(str));
    }

    public LicenseResult a(String[] strArr) {
        LicenseResult licenseResult = LicenseResult.INVALID;
        return LicenseResult.a(nativeIsExtensionLicenseStringValid(strArr));
    }

    public LicenseResult b(String str) {
        boolean nativeIsClientIdValid = nativeIsClientIdValid(str);
        this.a = nativeIsClientIdValid;
        return nativeIsClientIdValid ? LicenseResult.VALID : LicenseResult.INVALID;
    }

    public Date b() {
        return new Date(nativeGetExpiry());
    }

    public void c() {
        nativeUnlicense();
    }
}
